package com.lin.service.impl;
import com.lin.dao.IAccountDao;
import com.lin.domain.Account;
import com.lin.service.IAccountService;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service("accountService")
@Aspect
public class AccountServiceImpl implements IAccountService {
    @Autowired
    private IAccountDao accountDao;


    @Override
    public List<Account> findAll() {
        System.out.println("findall执行了");
        return accountDao.findAll();
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT,readOnly = true)
    public void saveAccount(Account account) {
        System.out.println("save方法执行了"+account);
        accountDao.saveAccount(account);
    }
}
